1. Field of the Invention
In general, the present invention relates to processing commands on a transport communication system (TCS). More specifically, the present invention provides a method, system and program product for closing a communication session with outstanding data commands on a TCS.
2. Related Art
As the use of network communications in software solutions becomes more common, various issues regarding session closures are raised. For example, in a transport communication system (TCS) multiple transport/protocol layers are included. An application will typically send a data command/request (e.g., a read or write command) to the TCS (which is processed by one or more of the transport layers), and then wait to receive a response. This period of communication between the application and the TCS is commonly known as a communication session. However, in communication systems that process an asynchronous read data or write data command, there needs to be a fast and safe way to close a communication session while the read or write is outstanding.
The problem and solution are unique in that each read, write, or close command involves processing at each transport layer. Specifically, one layer works on the command, and then sends the command to the next layer, and so on. When the last layer receives the command, it then sends the response back up the series of layers, and each layer also can process the response. However, the TCS needs to be very performance sensitive, avoiding as much as possible semaphore and synchronization logic.
In general, a close command cannot be indiscriminately given to the TCS at the same time the read or write is being processed by the TCS, or the system may fail due to data integrity problems and or race conditions. One known approach to this problem is to have the application code that sits “above” the TCS to attempt a read or write with a short timeout, and if the read or write returns after the timeout amount of time without completing the read or write operation, then the application code can decide to close the session. This method is cumbersome for the application to implement, and can degrade performance significantly. Another approach is it to implement synchronization logic so that each transport layer can synchronize itself on whatever operation it is currently executing so that more than one operation is not attempted. However, as indicated above, there is a desire to avoid implementing such logic due to the effort and resources it would require.
In view of the foregoing, there exists a need for a method, system and program product for closing a communication session with outstanding data commands on a TCS. Specifically, a need exists for a system that can allow a communication session with TCS having current data command to be closed without causing errors or performance degradation.